package com.cqc.other;

import org.junit.Test;

/**
 * @author cui
 *
 * @description 测试while中的 return break 终止情况。
 * @date 2022/3/24
 **/
public class WhileForReturn {

    @Test
    public void f1(){
        int a=0;
        while (a<3){
            System.out.println("while start");
            a++;
            for (int i = 0; i < 3; i++) {
                if(i==2){
                    return;
                    //break;
                }
            }
            System.out.println("while end");
        }
        System.out.println("aa");
    }
    @Test
    public void f2(){
        int a=0;
        while (true){
            while (true){
                System.out.println("while2");
                break;
            }
            System.out.println("while");
            break;
        }
    }
    @Test
    public void f3(){
        String a= "a#b#";
        String[] arr = a.split("#");
        String[] arr1 = a.split("#",1);
        System.out.println(arr.length);
    }
}
